﻿<phone:PhoneApplicationPage
	x:Class="Yammer.Activities.Views.MainPage"
	x:Name="MainPhoneAppPage"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:controls="clr-namespace:Yammer.Activities.Controls"
	mc:Ignorable="d"
	d:DataContext="{d:DesignData ../SampleData/MainViewModelSampleData.xaml}"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Portrait"  Orientation="Portrait"
	shell:SystemTray.IsVisible="False">

	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="YammerProgressBar" TargetType="ProgressBar">
			<Setter Property="Padding" Value="0"/>
			<Setter Property="Margin" Value="0"/>
			<Setter Property="Height" Value="10"/>
			<Setter Property="IsIndeterminate" Value="True"/>
			<Setter Property="VerticalAlignment" Value="Top"/>
		</Style>
        
    </phone:PhoneApplicationPage.Resources>
	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent">
		<Grid.RowDefinitions>
			<RowDefinition x:Name="ProgressBarRow" Height="10"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		<!-- LOCALIZATION NOTE:
			To localize the displayed strings copy their values to appropriately named
			keys in the app's neutral language resource file (AppResources.resx) then
			replace the hard-coded text value between the attributes' quotation marks
			with the binding clause whose path points to that string name.

			For example:

				Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"

			This binding points to the template's string resource named "ApplicationTitle".

			Adding supported languages in the Project Properties tab will create a
			new resx file per language that can carry the translated values of your
			UI strings. The binding in these examples will cause the value of the
			attributes to be drawn from the .resx file that matches the
			CurrentUICulture of the app at run time.
		 -->

		 <!--Panorama control-->
		<phone:Panorama Grid.Row="1" x:Name="MainPanorama" Margin="0,-10,0,0">
			<phone:Panorama.Title>
					<TextBlock x:Name="MainPanoramaText" Text="{Binding Title}"/>
			</phone:Panorama.Title>
			<phone:Panorama.Background>
				<ImageBrush ImageSource="/Yammer.Activities;component/Assets/PanoramaBackground.png"/>
			</phone:Panorama.Background>

			<!--Panorama item one-->
			<phone:PanoramaItem Visibility="{Binding HideLogin}">
				<phone:PanoramaItem.Header>
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<TextBlock Grid.Row="0" 
								   x:Name="HeaderTextItem1" 
								   Text="{Binding FirstItemTitle}"/>
					</Grid>
				</phone:PanoramaItem.Header>
					<controls:UserLoginControl x:Name="LoginControl"
											   Grid.Row="0"
											   VerticalAlignment="Top"
											   IsEnabled="{Binding EnableLoginControl}"/>
			</phone:PanoramaItem>

			<!--Panorama item two-->
			<phone:PanoramaItem Visibility="{Binding ShowSecondaryPanoramaItems}">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto"/>
						<RowDefinition Height="*"/>
					</Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" 
                                x:Name="UserProfile"
                                Orientation="Vertical"
                                Visibility="{Binding UserProfileVisibility}" >
					<Image
						   x:Name="Mugshot" 
						   Source="{Binding UserMugshot}"
                           VerticalAlignment="Top"
                           HorizontalAlignment="Left"
                           Width="120"
                           Height="120"/>
                        <TextBlock Text="{Binding UserFullName}"
                                   Style="{StaticResource PhoneTextExtraLargeStyle}"
                                   FontSize="{StaticResource PhoneFontSizeLarge}"/>
                        <TextBlock Text="{Binding JobTitle}"
                                   Style="{StaticResource PhoneTextSubtleStyle}"/>
                    </StackPanel>
                    <ScrollViewer Grid.Row="1">
                        <StackPanel>
                            <TextBlock Text="Activity Title"/>
                            <TextBox x:Name="ActivityTitle" IsEnabled="{Binding IsCreateReady}"/>

                            <TextBlock Text="Message"/>
                            <TextBox x:Name="ActivityBody"
						             AcceptsReturn="True"
						             Height="150"
                                     IsEnabled="{Binding IsCreateReady}"/>
                        
                            <RadioButton x:Name="ServerType"
                                         GroupName="OgoType"
                                         Content="Server Ticket" 
                                         IsChecked="True"
                                         IsEnabled="{Binding IsCreateReady}"/>
                            <RadioButton x:Name="PhoneType" 
                                         GroupName="OgoType" 
                                         Content="Phone Ticket"
                                         IsEnabled="{Binding IsCreateReady}"/>
                            <RadioButton x:Name="UpdateType"
                                         GroupName="OgoType" 
                                         Content="Update"
                                         IsEnabled="{Binding IsCreateReady}"/>

                            <Grid>
                                <TextBlock Text="Couldn't create contract :("
                                           Foreground="DarkRed"
                                           Visibility="{Binding ActivityCreationError}"/>
                                <Button x:Name="Create" Content="Create"
                                        HorizontalAlignment="Right"
                                        IsEnabled="{Binding IsCreateReady}"/>
                            </Grid>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
			</phone:PanoramaItem>
            
            <phone:PanoramaItem Header="Activities List"
                                Orientation="Vertical" 
                                Visibility="{Binding ShowSecondaryPanoramaItems}">
                <!--Double line list with image placeholder and text wrapping using a floating header that scrolls with the content-->
                <phone:LongListSelector Margin="0,0,-22,2" ItemsSource="{Binding OpenGraphObjects}">
                    <phone:LongListSelector.ListHeaderTemplate>
                        <DataTemplate>
                            <Grid Margin="12,0,0,38">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                            </Grid>
                        </DataTemplate>
                    </phone:LongListSelector.ListHeaderTemplate>
                    <phone:LongListSelector.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="12,2,0,4" Height="105" Width="432">
                                <!--Replace rectangle with image-->
                                <Border BorderThickness="1" Width="99" Height="99" BorderBrush="#FFFFC700" Background="#FFFFC700"/>
                                <StackPanel Width="311" Margin="8,-7,0,0">
                                    <TextBlock Text="{Binding LineOne}"
												   TextWrapping="Wrap" Margin="10,0" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeLarge}" />
                                    <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />
                                    <TextBlock Text="{Binding LineThree}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </phone:LongListSelector.ItemTemplate>
                </phone:LongListSelector>
            </phone:PanoramaItem>

			<!--Panorama item three - Messages-->
			<!--<phone:PanoramaItem Header="Messages" Orientation="Horizontal" Visibility="{Binding ShowSecondaryPanoramaItems}">				
                <phone:LongListSelector Margin="0,0,-22,2" ItemsSource="{Binding Items}">
                    <phone:LongListSelector.ListHeaderTemplate>
                        <DataTemplate>
                            <Grid Margin="12,0,0,38">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <TextBlock Text="Messages"
											   Style="{StaticResource PanoramaItemHeaderTextStyle}"
											   Grid.Row="0"/>
                            </Grid>
                        </DataTemplate>
                    </phone:LongListSelector.ListHeaderTemplate>
                    <phone:LongListSelector.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="12,2,0,4" Height="105" Width="432">
                                <Border BorderThickness="1" Width="99" Height="99" BorderBrush="#FFFFC700" Background="#FFFFC700"/>
                                <StackPanel Width="311" Margin="8,-7,0,0">
                                    <TextBlock Text="{Binding LineOne}"
												   TextWrapping="Wrap" Margin="10,0" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeLarge}" />
                                    <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </phone:LongListSelector.ItemTemplate>
                </phone:LongListSelector>
			</phone:PanoramaItem>-->
		</phone:Panorama>
		<TextBox HorizontalAlignment="Left" Height="6" Margin="-133,196,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="24"/>
		<ProgressBar Grid.Row="0" 
					 x:Name="ProgressBarItem1"
					 Width="{Binding ElementName=MainPhoneAppPage, Path=ActualWidth}"
					 IsEnabled="{Binding Item1IsBusy}"
					 Visibility="{Binding ProgressItem1Visibility}"
					 Style="{StaticResource YammerProgressBar}"/>
		<!--<phone:WebBrowser x:Name="WebView"
						  Grid.Row="1"
						  Margin="0,-10,0,0"
						  Width="{Binding ElementName=MainPhoneAppPage, Path=ActualWidth}"
						  Height="{Binding ElementName=MainPhoneAppPage, Path=ActualHeight}"
						  VerticalContentAlignment="Stretch"
						  Visibility="Collapsed"
						  IsEnabled="False"/>-->

		<!--Uncomment to see an alignment grid to help ensure your controls are
			aligned on common boundaries.  The image has a top margin of -32px to
			account for the System Tray. Set this to 0 (or remove the margin altogether)
			if the System Tray is hidden.

			Before shipping remove this XAML and the image itself.-->
		<!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->

	</Grid>
</phone:PhoneApplicationPage>